package com.chinairi.mall.service;

import com.chinairi.mall.controller.viewobject.ProjectPlanReqVO;
import com.chinairi.mall.controller.viewobject.ReqModelVO;
import com.chinairi.mall.model.ProjectPlanReq;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chinairi.mall.model.ProjectPlanReqAddress;
import com.chinairi.mall.model.ProjectPlanReqDetail;
import com.chinairi.mall.service.modelobject.ProjectPlanReqApproveMO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author gsl
 * @since 2020-09-19
 */
public interface IProjectPlanReqService extends IService<ProjectPlanReq> {

    /**
     * 生成需求计划
     * @param projectPlanReqVO
     */
    void addPlanReq(ProjectPlanReqVO projectPlanReqVO);

    /**
     *
     * @param response
     * @param reqModelVo
     * @throws IOException
     */
    void exportExcel(HttpServletResponse response, ReqModelVO reqModelVo) throws IOException;

    /**
     * 批量设置收货地址和到货时间
     * @param projectPlanReqDetailList
     */
    void updateAddressAndTime(List<ProjectPlanReqDetail> projectPlanReqDetailList);

    /**
     * 更新
     * @param projectPlanReqDetail
     */
    void updateDetail(ProjectPlanReqDetail projectPlanReqDetail);

    /**
     * 新增一条需求计划中的物料
     * @param projectPlanReqDetail
     */
    void addMaterial(ProjectPlanReqDetail projectPlanReqDetail);

    /**
     *
     * @param planReqId
     * @return
     */
    ProjectPlanReqVO getReqDetail(String planReqId);

    /**
     * 删除一条计划下的物料
     * @param planDetailId
     * @return
     */
    void deleteByDetailId(String planDetailId);

    /**
     * 更新审核状态
     * @param projectPlanReq
     */
    void updateStatus(ProjectPlanReq projectPlanReq);

    /**
     * 获取本用户单位下的需求计划列表啊
     * @param
     * @return
     */
    List<ProjectPlanReq> getList(ProjectPlanReq projectPlanReq);

    /**
     * 删除某一需求计划
     * @param planReqId
     */
    void deleteById(String planReqId);

    /**
     * 提交某条记录进入审核，该接口将这条记录的状态字段置为3-审核中。
     * @param projectPlanReq
     */
    void addApprove(ProjectPlanReq projectPlanReq);

    /**
     *获取待审核的数据记录，此时审核状态应为3-审核中，或者除了状态为0的其余所有记录均返回即可。
     * @param projectPlanReqApproveMo
     * @return
     */
    List<ProjectPlanReqApproveMO> getNeedApprove(ProjectPlanReqApproveMO projectPlanReqApproveMo);

    /**
     * 更新某条计划的审核状态
     * @param projectPlanReqApproveMo
     */
    void updateApprove(ProjectPlanReqApproveMO projectPlanReqApproveMo);

    /**
     * 单独新增需求计划
     * @param projectPlanReq
     */
    String addNewReq(ProjectPlanReq projectPlanReq);

    Map<String,Object> updateProjectPlanReq(ProjectPlanReqVO projectPlanReqVO);

    /**
     * 根据需求计划id查询仓库地址以及项目地址
     * @param planReqId 需求计划id
     * @return ProjectPlanReqAddress
     */
    ProjectPlanReqAddress getProjectAddressOrStorageAddress(String planReqId);
}
